package com.study.jdbc.utils;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.beanutils.BeanUtils;


public class WebUtil {

	public static <T> T fillBean(HttpServletRequest request,
			Class<T> clazz) {
		T bean = null ;
		try {
			bean = clazz.newInstance();
			BeanUtils.populate(bean, request.getParameterMap()) ;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return bean ;
	}

}
